<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }
        
        img {
            vertical-align: top;
        }
        
        header {
            box-sizing: border-box;
            width: 1423px;
            height: 251px;
            margin: 0 auto;
        }
        
        header .header_top {
            box-sizing: border-box;
            width: 1423px;
            height: 168px;
            margin: 0 auto;
        }
        
        nav {
            position: relative;
            box-sizing: border-box;
            width: 1423px;
            height: 83px;
            margin: 0 auto;
        }
        
        main {
            box-sizing: border-box;
            width: 1001px;
            height: 2734px;
            margin: 0 auto;
        }
        
        .p {
            position: fixed;
            top: 0;
        }
    </style>
</head>

<body>
    <header>
        <aside class="header_top">
            <img src="./img/top.png" alt="图片">
        </aside>
        <nav>
            <img src="./img/nav.png" alt="图片">
        </nav>
    </header>
    <main>
        <img src="./img/main.png" alt="图片">
    </main>
    <script src="js/jquery-3.6.0.js"></script>
    <script>
        $(function() {
            $(window).scroll(function() {
                var top = $(document).scrollTop();
                if (top >= 168) {
                    $("nav").addClass("p");
                } else {
                    $("nav").removeClass("p");
                }
            })
        })
    </script>
</body>

</html>